home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text;
-
- import java.awt.event.ActionEvent;
-
- public class DefaultEditorKit$DefaultKeyTypedAction extends TextAction {
- public DefaultEditorKit$DefaultKeyTypedAction() {
- super("default-typed");
- }
-
- public void actionPerformed(ActionEvent e) {
- JTextComponent target = ((TextAction)this).getTextComponent(e);
- if (target != null && e != null) {
- String content = e.getActionCommand();
- int mod = e.getModifiers();
- if (content != null && content.length() > 0 && (mod & 8) == 0) {
- char c = content.charAt(0);
- if (c >= ' ' && c != 127) {
- target.replaceSelection(content);
- }
- }
- }
-
- }
- }
-